<template>
    <div class="container">
        <el-alert :title="title" :description="description" :info1="execTitle" :info2="execDescription"
                  :type="propJson.type"
                  :effect="propJson.effect"
                  :closable="propJson.isClosable"
                  :center="propJson.isCenter"
                  :show-icon="propJson.isShowIcon"/>
    </div>
</template>

<script name="AlertMessageComponent" lang="ts" setup>
import {doThirdServiceValue} from "@/utils/lowcode/thirdService";
import {computed, defineProps, ref} from "vue";

let props = defineProps(['propJson', 'commonParam']);

let propJson = computed(() => {return props['propJson']})
let commonParam = computed(() => {return props['commonParam']})

let title = ref("");
let description = ref("");

let execTitle = computed(async () => {
    await doThirdServiceValue(propJson.value.titleActionInfo, commonParam.value, execTitleThen, () => {
    }, null)
})

let execDescription = computed(async () => {
    await doThirdServiceValue(propJson.value.descriptionActionInfo, commonParam.value, execDescriptionThen, () => {
    }, null)
})

function execTitleThen(resValue, execParam) {
    title.value = resValue;
}

function execDescriptionThen(resValue, execParam) {
    description.value = resValue;
}
</script>

<style scoped lang="less">

</style>